Simplify matrix manipulation now that cairo exposes the cairo_matrix_t
authorCarl Worth <cworth@src.gnome.org>
Fri, 8 Apr 2005 17:21:09 +0000 (17:21 +0000)
committerCarl Worth <cworth@src.gnome.org>
Fri, 8 Apr 2005 17:21:09 +0000 (17:21 +0000)
        * gdk/gdkpango.c: (emboss_context): Simplify matrix manipulation
        now that cairo exposes the cairo_matrix_t structure.

        * gdk/gdkpixbuf-render.c: (gdk_pixbuf_set_as_cairo_source): Track
        cairo API change in signedness of data argument.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gdk/gdkpango.c
gdk/gdkpixbuf-render.c

index 8622dff4b3a2da1e84741ea0e63fc8a2f560a3b9..5c42d1eb5a7e55b2eb0e20209ff000c51c778812 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-04-08  Carl Worth  <cworth@cworth.org>
+
+       * gdk/gdkpango.c: (emboss_context): Simplify matrix manipulation
+       now that cairo exposes the cairo_matrix_t structure.
+       
+       * gdk/gdkpixbuf-render.c: (gdk_pixbuf_set_as_cairo_source): Track
+       cairo API change in signedness of data argument.
+
 2005-04-08  Matthias Clasen  <mclasen@redhat.com>
 
        Fix double-click to autosize treeview columns. This was
index 8622dff4b3a2da1e84741ea0e63fc8a2f560a3b9..5c42d1eb5a7e55b2eb0e20209ff000c51c778812 100644 (file)
@@ -1,3 +1,11 @@
+2005-04-08  Carl Worth  <cworth@cworth.org>
+
+       * gdk/gdkpango.c: (emboss_context): Simplify matrix manipulation
+       now that cairo exposes the cairo_matrix_t structure.
+       
+       * gdk/gdkpixbuf-render.c: (gdk_pixbuf_set_as_cairo_source): Track
+       cairo API change in signedness of data argument.
+
 2005-04-08  Matthias Clasen  <mclasen@redhat.com>
 
        Fix double-click to autosize treeview columns. This was
index 8622dff4b3a2da1e84741ea0e63fc8a2f560a3b9..5c42d1eb5a7e55b2eb0e20209ff000c51c778812 100644 (file)
@@ -1,3 +1,11 @@
+2005-04-08  Carl Worth  <cworth@cworth.org>
+
+       * gdk/gdkpango.c: (emboss_context): Simplify matrix manipulation
+       now that cairo exposes the cairo_matrix_t structure.
+       
+       * gdk/gdkpixbuf-render.c: (gdk_pixbuf_set_as_cairo_source): Track
+       cairo API change in signedness of data argument.
+
 2005-04-08  Matthias Clasen  <mclasen@redhat.com>
 
        Fix double-click to autosize treeview columns. This was
index 4f26ab70d44ceabf8bb6ca61eace6f10ed0d6f5b..1fe43e707112634f52a9c1696c302e58c2974526 100644 (file)
@@ -118,18 +118,16 @@ gdk_pango_renderer_constructor (GType                  type,
 static void
 emboss_context (cairo_t *cr)
 {
-  cairo_matrix_t *tmp_matrix = cairo_matrix_create ();
-  double a, b, c, d, tx, ty;
+  cairo_matrix_t tmp_matrix;
 
   /* The gymnastics here to adjust the matrix are because we want
    * to offset by +1,+1 in device-space, not in user-space,
    * so we can't just draw the layout at x + 1, y + 1
    */
-  cairo_get_matrix (cr, tmp_matrix);
-  cairo_matrix_get_affine (tmp_matrix, &a, &b, &c, &d, &tx, &ty);
-  cairo_matrix_set_affine (tmp_matrix, a, b, c, d, tx + 1, ty + 1);
-  cairo_set_matrix (cr, tmp_matrix);
-  cairo_matrix_destroy (tmp_matrix);
+  cairo_get_matrix (cr, &tmp_matrix);
+  tmp_matrix.x0 += 1.0;
+  tmp_matrix.y0 += 1.0;
+  cairo_set_matrix (cr, &tmp_matrix);
 
   cairo_set_rgb_color (cr, 1.0, 1.0, 1.0);
 }
index 52c54c5a02a3c942157f03d160ab483b2b5d691b..e88e5a6ad57fbd55aff1624b635d66aee1f7f881 100644 (file)
@@ -362,8 +362,9 @@ gdk_pixbuf_set_as_cairo_source (GdkPixbuf *pixbuf,
     format = CAIRO_FORMAT_ARGB32;
 
   cairo_pixels = g_malloc (4 * width * height);
-  surface = cairo_image_surface_create_for_data ((char *)cairo_pixels, format,
-                                              width, height, 4 * width);
+  surface = cairo_image_surface_create_for_data ((unsigned char *)cairo_pixels,
+                                                format,
+                                                width, height, 4 * width);
   cairo_surface_set_user_data (surface, &key,
                               cairo_pixels, (cairo_destroy_func_t)g_free);